package com.mebs.model;

import org.jt.jet.content.JetNamedObject;

public enum VolumeUnit implements JetNamedObject {
    CFT(1, "Cubic foot", 'E', 0.3048 * 0.3048 * 0.3048),
    CBM(2, "Cubic meter", 'X', 1.0);

    public final int type;
    public final String name;
    public final Character veryShortName;
    public final Double coef; // to 1 cubic meter

    VolumeUnit(int type, String name, Character veryShortName, Double coef)
    {
        this.type = type;
        this.name = name;
        this.veryShortName = veryShortName; 
        this.coef = coef;
    }

    public static VolumeUnit getObjectByType(int type)
    {
        return VolumeUnit.values()[type - 1];
    }

    public Object getObjectId()
    {
        return type;
    }

    public String getObjectName()
    {
        return name;
    }

    public int getType()
    {
        return type;
    }

    public String getName()
    {
        return name;
    }
    
    public Character getVeryShortName()
    {
        return veryShortName;
    }

    public Double getCoef()
    {
        return coef;
    }
}
